<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图书后台管理</title>
    <link rel="stylesheet" type="text/css" href="../static/admin/css/reset.css">
    <link rel="stylesheet" type="text/css" href="../static/admin/css/main.css">
    <link rel="stylesheet" type="text/css" href="../static/admin/css/jquery.pagination.css">
    <script src="../static/admin/js/jquery-1.12.4.min.js"></script>
    <script src="../static/admin/js/jquery.pagination.min.js"></script>
</head>
<body>
<div class="breadcrub">
    当前位置：图书管理>图书分类管理
</div>
<div>
    <center style="color: red;font-size: 25px">{{ get_flashed_messages()[0] }}</center>
    <center style="color: red;font-size: 25px">{{ get_flashed_messages()[1] }}</center>
    <table class="common_table" style="margin: auto;width: 90%;background: white">
        <tr>
            <td colspan="6"><a class="addtype" style="font-size: 20px">图书列表</a></td>
        </tr>

        <tr style="background: #779ECB">
            <th width="10%" style="font-size: 18px">序号</th>
            <th width="20%" style="font-size: 18px">名称</th>
            <th width="10%" style="font-size: 18px">作者</th>
            <th width="10%" style="font-size: 18px">分类</th>
            <th width="10%" style="font-size: 18px">修改</th>
            <th width="10%" style="font-size: 18px">删除</th>
        </tr>

        {% for i in pagination.items %}
            <tr>
                <td width="10%" style="font-size: 14px">{{ per_page*(page_num-1)+loop.index }}</td>
                <td width="20%" style="font-size: 14px">{{ i.name }}</td>
                <td width="10%" style="font-size: 14px">{{ i.author }}</td>
                <td width="10%" style="font-size: 14px">{{ i.cate.name }}</td>
                <td style="font-size: 14px"><a href="/updatebook/{{ i.id }}">修改</a></td>
                <td style="font-size: 14px"><a href="/deletebook/{{ i.id }}">删除</a></td>
            </tr>
        {% endfor %}
        <tr>
            <td style="text-align: center" colspan="6">
                <a href="/goodslist?page_num={{ per_num }}">上一页</a>
                {% for pag in pagination.iter_pages() %}
                    <a href="/goodslist?page_num={{ pag }}">{{ pag }}</a>
                {% endfor %}
                <a href="/goodslist?page_num={{ next_num }}">下一页</a>
            </td>

        </tr>

    </table>
</div>

</body>
</html>